<template>
  <div class="container">
    <dl class="fly-panel fly-list-one">
      <dt class="fly-panel-title">本周热议</dt>
      <dd v-for="(item, index) in list" :key="'hotList' + index">
        <a href="jie/detail.html">{{item.title}}</a>
        <span><i class="iconfont icon-pinglun1"></i> {{item.answer}}</span>
      </dd>
      <!-- 无数据时 -->
      <div class="fly-none" v-if="list.length === 0">没有相关数据</div>
    </dl>
  </div>
</template>
<script>
import { getHotList } from '@/api/content';

export default {
  name: 'HotList',
  data () {
    return {
      list: []
    };
  },
  methods: {
    getList () {
      getHotList().then(res => {
        this.list = res.data;
      });
    }
  },
  mounted () {
    this.getList();
  }
};
</script>
<style scoped lang="scss">

</style>
